const path = require('path');

function resolve(dir) {
	return path.join(__dirname, dir);
}

module.exports = {
	devServer: {
		port: 8000,
		proxy: {
			'/api': {
				target: 'http://127.0.0.1:3000',
				changeOrigin: true,
				pathRewrite: {
					'^/api': '/'
				}
			}
		}
	},
	chainWebpack: config => {
		config.resolve.alias
			.set('styles', resolve('src/assets/styles'))
	}
}